package presentation.models;

import java.util.Vector;

import javax.swing.DefaultListModel;

import presentation.UIPost;


/**
 * list model for the presented posts in a thread
 * manages all the presented posts
 */
public class PostListModel extends DefaultListModel
{
	
	private static final long serialVersionUID = 5706654699537930590L ;

	/**
	 * constructor
	 */
	public PostListModel(){
		super();
	}
	
	/**
	 * sets the list model to hold the given posts
	 * @param threadPosts - the posts to be presented in the thread
	 */
	public void setPosts(Vector<UIPost> threadPosts){
		this.removeAllElements();
		for(int i=0; i<threadPosts.size(); i++){
			this.addElement(threadPosts.elementAt(i));
		}
	}
	


	
}

